# coding=utf-8
from flask import Flask,request
from flask import render_template

from reserch import reserch4letters

app = Flask(__name__)


@app.route('/',methods=['GET'])
def hello_world():
    return render_template('index.html')

@app.route('/login',methods=['GET'])
def download():
    return render_template('login.html')


@app.route('/third',methods=['GET'])
def wrong():
    return render_template('third.html')



@app.route('/second',methods=['GET'])
def next():
    return render_template('second.html')



@app.route('/last',methods=['GET'])
def world():
    return render_template('last.html')

#课程表具体信息

@app.route('/timetable',methods=['GET'])
def classchart():
    return render_template('timetable.html')



@app.route('/前端开发框架',methods=['GET'])
def 前端开发框架():
    return render_template('课程表具体信息/前端开发框架.html')

@app.route('/API',methods=['GET'])
def API():
    return render_template('课程表具体信息/API.html')

@app.route('/用户视觉界面设计',methods=['GET'])
def 用户视觉界面设计():
    return render_template('课程表具体信息/用户视觉界面设计.html')

@app.route('/新媒体分析和用户体验',methods=['GET'])
def 新媒体分析和用户体验():
    return render_template('课程表具体信息/新媒体分析与用户体验.html')

@app.route('/人与自然',methods=['GET'])
def 人与自然():
    return render_template('课程表具体信息/人与自然.html')

@app.route('/羽毛球',methods=['GET'])
def 羽毛球():
    return render_template('课程表具体信息/羽毛球.html')

@app.route('/马克思主义基本原理',methods=['GET'])
def 马克思主义基本原理():
    return render_template('课程表具体信息/马克思主义基本原理.html')


@app.route('/VI设计与品牌策划',methods=['GET'])
def VI设计与品牌策划():
    return render_template('课程表具体信息/VI设计与品牌策划.html')

@app.route('/流行文化',methods=['GET'])
def 流行文化():
    return render_template('课程表具体信息/流行文化.html')

@app.route('/新媒体设计与项目管理',methods=['GET'])
def 新媒体设计与项目管理():
    return render_template('课程表具体信息/新媒体设计与项目管理.html')

# @app.route('/result',methods=['POST'])
# def results():
#     py_word = request.form['phrase']
#     py_vowels = request.form['letter']
#     py_found = reserchletters(py_vowels, py_word)
#
#     return render_template('results.html',
#                            found=py_found)
@app.route('/result',methods=['POST'])
def results():

    py_word = request.form['phrase']
    py_vowels = request.form['letter']
    py_found = reserch4letters(py_vowels,py_word)

    return render_template('result.html',
                           found = py_found,
                           )

@app.route('/hello',methods=['GET','POST'])
def result():
    py_firstname = request.form['firstname']
    py_lastname = request.form['lastname']
    py_fullname = py_firstname.title()+' '+py_lastname.title()
    py_say = request.form['yousay']
    return render_template('hello.html',
                           fullname=py_fullname,
                           say=py_say)



if __name__ == '__main__':
    app.run()